{% extends 'TopxiaAdminBundle:Group:layout.html.twig' %}
{% set menu = 'thread' %}
{% block title %}话题管理{% endblock %}
{% set script_controller='group/thread' %}
{% block main %}

  <div class="page-header">
    <h1>话题管理</h1>
  </div>

  <form  class="form-inline well well-sm" action="" method="get" novalidate>

    <div class="form-group">
      <select class="form-control" name="status">
        {{ select_options(dict('groupstatus'), app.request.query.get('status'), '话题状态') }}
      </select>
    </div>

    <div class="form-group">
      <input class="form-control" type="text" placeholder="所属小组" name="groupName" value="{{ app.request.get('groupName') }}">
    </div>

    <div class="form-group">
      <input class="form-control" type="text" placeholder="话题名称关键词" name="title" value="{{ app.request.get('title') }}">
    </div>

    <div class="form-group">
      <input class="form-control" type="text" placeholder="创建者" name="userName" value="{{ app.request.get('userName') }}">
    </div>
    
    <button class="btn btn-primary">搜索</button>
  </form>
  {% if threadinfo %}
  <form method="post" id="thread-form">

      <table class="table table-striped table-hover" id="thread-table">

        <thead>
        <tr>
          <th width="7%"><input type="checkbox"  data-role="batch-select"/> 编号</th>
          <th width="43%">名称</th>
          <th>创建者</th>
          <th>所属小组</th>
          <th>回复数</th>
          <th>状态</th>
          <th>操作</th>
        </tr>
        </thead>

        <tbody>
          {% for thread in threadinfo %}  
          {% include 'TopxiaAdminBundle:Group:thread-table-tr.html.twig' with {thread:thread} %}
        {% endfor %}
        </tbody>

        <tr>  

          <td><label class="checkbox-inline"><input type="checkbox" data-role="batch-select"> 全选</label>
          </td> 

          <td>   
           <input type="hidden" id="batchDeleteThread" value="{{path('admin_groupThread_batch_delete')}}">
           
           <button id="deleteThread" data-submiting-text="正在删除" type="button" class="btn btn-default btn-sm"
           >删除话题</button>
 
          </td>

        </tr>

       </table>

       <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">

   </form>
   {% else %}
      <div class="empty">暂无话题！</div>
   {% endif %}
   <div class="pull-right">
 {{ web_macro.paginator(paginator) }}
</div>
{% endblock %}